<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>Document</title>
<link rel="stylesheet" href="../assets/agile/css/ratchet/css/ratchet.min.css">
<link rel="stylesheet" href="../assets/agile/css/flat/flat.component.css">
<link rel="stylesheet" href="../assets/agile/css/flat/flat.color.css">
<link rel="stylesheet" href="../assets/agile/css/flat/iconline.css">
<link rel="stylesheet" href="../assets/app/css/app.css" />
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/jquery.js"></script>
<script type="text/javascript" src="../script/config.js"></script>
<script type="text/javascript" src="../script/local.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
</head>
<body>

<!--通用顶部-->
<div id="ios-top-box">
    <div id="header" class="bar bar-nav">
    <div class="titlebar">
    <a href="javascript:appClose('userfufen',api);"><i class="iconfont iconline-arrow-left"></i></a>
    <h1 class="title">我的福分</h1>
    </div>
    </div>
</div>
<!--通用顶部结束-->
<header class="bar bar-nav head_a" style="height:20px;margin-top:43px;padding-left:5px;padding-right:5px;border-bottom:1px solid #e4e4e4;">
	<a href="javascript:;" style="width:33.33%;height:20px;line-height:20px;">时间</a>
	<a href="javascript:;" style="width:33.33%;height:20px;line-height:20px;">渠道</a>
	<a href="javascript:;" style="width:33.33%;height:20px;line-height:20px;">获得/支出</a>
</header>
<section class="notBottom" style="margin-top:90px !important;">
    <div class="scroller create_goods">
		<div style="background: #fff;border-bottom:1px solid #e4e4e4;font-size:12px;">
		<p>可用福分：<b class="orange fmoney">0.00</b></p>
		<p style="display: none;">可用金钱：<?php echo $member['score'];?>福分 / <?php echo $conf['fufen_yuan'];?>福分<span>(1元=<?php echo $conf['fufen_yuan'];?>福分)</span>	 = <?php echo $fufen_to_money;?>元<span>(取整)</span></p>
		</div>
       <div class="lines">
       	<table style="width:100%;text-align:center;background:#fff;">
		<tbody></tbody>
		</table>
       	 <p style="text-align: center;display:none;">暂无记录</p>
       </div>
		<div class="loadings" style="border-top:1px solid #e4e4e4;">
	    	<span class="clickLoad">点击加载</span>
	    	<span class="clickLoading">加载中请稍后...</span>
		</div>
	</div>
</section>

<script type="text/javascript" charset="utf-8">
    var userinfo;
    if(userinfo = getUserinfo()){
        apiready = function(){
			var page = 1;
            api.showProgress({title : '加载中',text : ''});
    	GetJPData(config.url+'/app.php?act=userfufen&uid='+userinfo['uid'],{page:page},function(data){
    	    api.hideProgress();
    	    if(data['status'] == 1){
					if(data['data']){
						var html = "";
						for(var i=0; i<data['data'].length; i++){
						    html += '<tr><td>'+data['data'][i]['time']+'</td>';
						    html += '<td>'+data['data'][i]['content']+'</td><td>';
						    if(data['data'][i]['type']==1){
						    	html += '<font color="#0c0">+ '+data['data'][i]['money']+'</font>';
							}else{
					    		html += '<font color="red">- '+data['data'][i]['money']+'</font>';
							}
					    	html += '</td></tr>';
						}
						$('table tbody').append(html);
					}
		$('.fmoney').text(data['fufen_to_money']);
	var TotalPager = data['totalPager']?data['totalPager']:0;
	$('.clickLoad').click(function(){
		  api.showProgress({title : '加载中',text : ''});
		var _this = $(this);
		_this.hide();
		$('.clickLoading').css('display','block');
		page++;
		if(page>TotalPager){
			_this.hide();
			api.hideProgress();
			$('.clickLoading').text('加载完毕').css('display','block');
			return false;
		}
		
		GetJPData(config.url+'/app.php?act=userfufen&uid='+userinfo['uid'],{page:page},function(data){
				api.hideProgress();
				if(data['status']==1){
					_this.show();
					$('.clickLoading').hide();
					if(data['data']){
						var html = "";
						for(var i=0; i<data['data'].length; i++){
						    html += '<tr><td>'+data['data'][i]['time']+'</td>';
						    html += '<td>'+data['data'][i]['content']+'</td><td>';
						    if(data['data'][i]['type']==1){
						    	html += '<font color="#0c0">+ '+data['data'][i]['money']+'</font>';
							}else{
					    		html += '<font color="red">- '+data['data'][i]['money']+'</font>';
							}
					    	html += '</td></tr>';
						}
						$('table tbody').append(html);
					}
				}
		});
		
	});




    	    }else{
    	        $.PageDialog.fail('加载失败');
    	    }
    	});
    	        };
	}else{
	    $.PageDialog.fail('请登录用户');
	}
</script>
</body>
</html>